home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / Mpeg2Bits.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-12  |  1.5 KB  |  96 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation.  All rights reserved.
  4. //
  5. // Module Name:
  6. //
  7. //      Mpeg2Bits.h
  8. //
  9. // Abstract:
  10. //
  11. //      This file defines the MPEG-2 section header bitfields. These are
  12. //      defined here instead of in mpegstructs.idl because of MIDL
  13. //      compiler conflicts with bitfield definitions.
  14. //
  15. /////////////////////////////////////////////////////////////////////////////
  16.  
  17. #pragma once
  18.  
  19. #pragma pack(push)
  20. #pragma pack(1)
  21.  
  22.  
  23. //
  24. // PID structure
  25. //
  26.  
  27. #ifdef __midl
  28.  
  29. typedef struct
  30. {
  31.     WORD Bits;
  32. } PID_BITS_MIDL;
  33.  
  34. #else
  35.  
  36. typedef struct
  37. {
  38.     WORD Reserved  :  3;
  39.     WORD ProgramId : 13;
  40. } PID_BITS, *PPID_BITS;
  41.  
  42. #endif
  43.  
  44.  
  45.  
  46. //
  47. // Generic MPEG packet header structure
  48. //
  49.  
  50. #ifdef __midl
  51.  
  52. typedef struct
  53. {
  54.     WORD Bits;
  55. } MPEG_HEADER_BITS_MIDL;
  56.  
  57. #else
  58.  
  59. typedef struct
  60. {
  61.     WORD SectionLength          : 12;
  62.     WORD Reserved               :  2;
  63.     WORD PrivateIndicator       :  1;
  64.     WORD SectionSyntaxIndicator :  1;
  65. } MPEG_HEADER_BITS, *PMPEG_HEADER_BITS;
  66.  
  67. #endif
  68.  
  69.  
  70.  
  71. //
  72. // Long MPEG packet header structure
  73. //
  74.  
  75. #ifdef __midl
  76.  
  77. typedef struct
  78. {
  79.     BYTE Bits;
  80. } MPEG_HEADER_VERSION_BITS_MIDL;
  81.  
  82. #else
  83.  
  84. typedef struct
  85. {
  86.     BYTE CurrentNextIndicator : 1;
  87.     BYTE VersionNumber        : 5;
  88.     BYTE Reserved             : 2;
  89. } MPEG_HEADER_VERSION_BITS, *PMPEG_HEADER_VERSION_BITS;
  90.  
  91. #endif
  92.  
  93.  
  94.  
  95. #pragma pack(pop)
  96.